package service

import (
	"context"
	v1 "devops-super/api/public/v1"
	"devops-super/internal/model/mymodel"
	mqtt "github.com/eclipse/paho.mqtt.golang"
)

type (
	IAeemqx interface {
		GetWebMqttInfo(ctx context.Context, req *v1.QcpublicMqttInfoReq) (res *v1.QcpublicMqttInfoRes, err error)
		DoEmqxSub(ctx context.Context, mqttConf *mymodel.MqttConnectOption) (err error)
		HandleAeMqttData(ctx context.Context, msg mqtt.Message)
		SaveWaveToOss(ctx context.Context, server string, bucket string, path string, data []byte) (err error)
		DeleteWaveFromOss(ctx context.Context, server string, bucket string, path string) (err error)
		CommonAePublish(ctx context.Context, deviceNo string, aeType string, data []byte, ops *mymodel.EmqxPublishOps) (err error)
	}
)

var (
	localAeemqx IAeemqx
)

func Aeemqx() IAeemqx {
	if localAeemqx == nil {
		panic("implement not found for interface IAeemqx, forgot register?")
	}
	return localAeemqx
}

func RegisterAeemqx(i IAeemqx) {
	localAeemqx = i
}
